#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
    int n;
    scanf("%d", &n);
    int count = 0;
    while (n) {
        n = n & (n - 1);
        count++;
    }
    printf("%d", count);
	return 0;
}